home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 103
/
Vol 103.iso
/
games
/
x_traini.swf
/
scripts
/
frame_3
/
DoAction.as
Wrap
Text File
|
2010-03-13
|
3KB
|
154 lines
function detectKey(obj, iMoveDis)
{
if(Key.isDown(Key.UP))
{
_root.iTouch = _root.iTouch + 1;
if(0 < obj._y - iMoveDis)
{
obj._y -= iMoveDis;
}
}
else if(Key.isDown(Key.DOWN))
{
_root.iTouch = _root.iTouch + 1;
if(obj._y + iMoveDis < _root.I_SCREEN_HEIGHT)
{
obj._y += iMoveDis;
}
}
if(Key.isDown(Key.LEFT))
{
_root.iTouch = _root.iTouch + 1;
if(0 < obj._x - iMoveDis)
{
obj._x -= iMoveDis;
}
}
else if(Key.isDown(Key.RIGHT))
{
_root.iTouch = _root.iTouch + 1;
if(obj._x + iMoveDis < _root.I_SCREEN_WIDTH)
{
obj._x += iMoveDis;
}
}
}
function genBullet(sB, iB, iT)
{
if(iT == 0)
{
_root.attachMovie(sB,sB + iB,iB);
_root[sB + iB].mcRealBullet.iBulletV = _root.iBulletV;
_root[sB + iB].mcRealBullet.iType = iT;
_root[sB + iB].mcRealBullet.gotoAndStop(random(5) + 1);
}
else if(iT == 1)
{
_root.mcStatus.gotoAndPlay("highSpeed");
_root.attachMovie(sB,sB + iB,iB);
_root[sB + iB].mcRealBullet.iBulletV = _root.iBulletV * 1.5;
_root[sB + iB].mcRealBullet.iType = iT;
_root[sB + iB].mcRealBullet.gotoAndStop("highSpeed");
}
else if(iT == 2)
{
_root.mcStatus.gotoAndPlay("tracing");
_root.attachMovie(sB,sB + iB,iB);
_root[sB + iB].mcRealBullet.iBulletV = _root.iBulletV;
_root[sB + iB].mcRealBullet.iType = iT;
_root[sB + iB].mcRealBullet.gotoAndStop("tracing");
}
}
function getRank(i)
{
if(i < 3)
{
return "Protozoan!";
}
if(i < 6)
{
return "Monkey cup!";
}
if(i < 9)
{
return "Coelenterate!";
}
if(i < 12)
{
return "Echinoderm!";
}
if(i < 15)
{
return "Reptile!";
}
if(i < 18)
{
return "Mammal!";
}
if(i < 21)
{
return "Primate!";
}
if(i < 24)
{
return "Human being!";
}
if(i < 27)
{
return "Sportsman!";
}
if(i < 30)
{
return "Olympic champion!";
}
if(i < 33)
{
return "Street fighter!";
}
if(i < 36)
{
return "King of fighter!";
}
if(i < 39)
{
return "X-Man!";
}
if(i < 42)
{
return "Spiderman!";
}
if(i < 45)
{
return "Superman!";
}
if(i < 48)
{
return "Sprite!";
}
if(i < 51)
{
return "Angel!";
}
return "God!";
}
var I_SCREEN_WIDTH = 400;
var I_SCREEN_HEIGHT = 300;
var iBulletV = 3;
var iRoleV = 2;
var iDropStep = 3;
var iFPS = 24;
var I_TRACING_ACC = 2;
var S_BULLET = "mcBullet";
var I_HIGHSPEED_STEP = 4;
var I_TRACING_STEP = 5;
var sndBoom = new Sound(mcRole);
sndBoom.attachSound("sndBoom");
var sndBg = new Sound(_root);
sndBg.attachSound("sndBg");
var sndNormal = new Sound();
sndNormal.attachSound("sndNormal");
var sndHighspeed = new Sound();
sndHighspeed.attachSound("sndHighspeed");
var sndTracing = new Sound();
sndTracing.attachSound("sndTracing");